package Homework.Top1.Test2;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Company company=new Company();
        Member member=new Member();
        Scanner in=new Scanner(System.in);
        while (true){
            System.out.println("1.查看公司信息\t2.招聘人员\t3.辞退员工\t4.统计\t5.显示最佳员工\t6.涨薪\t7.退出");
            int choice=in.nextInt();
            if (choice==1){
                company.print();
            }else if (choice==2){
                System.out.println("请输入工号:");
                member.setWorkNum(in.next());
                System.out.println("请输入姓名：");
                member.setMeName(in.next());
                System.out.println("请输入性别:");
                member.setMeSex(in.next());
                System.out.println("请输入职务：");
                member.setMeWork(in.next());
                System.out.println("请输入薪资：");
                member.setMoney(in.nextDouble());
                boolean i=company.addList(member);
                System.out.println(i?"成功":"失败");
            }else if (choice==3){
                System.out.println("请输入要辞退员工的工号：");
                String workNum=in.next();
                company.delete(workNum);
                boolean a=company.delete(workNum);
                System.out.println(a?"辞退成功":"辞退失败");
            }else if (choice==4){
                company.showList();
            }else if (choice==5){
                member=company.moneyMax();
                System.out.println(member.getMeName()+"\t"+member.getMeSex()+"\t"+member.getMeAge()+"\t"+member.getWorkNum()+"\t"+member.getMoney());
            }else if (choice==7){
                System.out.println("退出");
                System.exit(0);
            }else if (choice==6){
                company.raiseSalary();
                boolean k=company.raiseSalary();
                System.out.println(k?"成功":"失败");
            }
        }
    }
}
